#!/bin/sh
dir=$(cd $(dirname $0);pwd)
cd $dir

git pull origin master
mvn clean package

pid=`jps | grep demo | awk '{print $1}' | awk 'NR==1'`

if [ -n "$pid" ]; then
    kill -9 $pid;
fi

nohup java -jar $dir/target/eurekaClient-0.0.1-SNAPSHOT.jar >> $dir/sh_log.log &